#!/bin/bash

mvn clean compile package install -DskipTests -f ../pom.xml

for i in $(seq 1 2)
do
    cp ../target/*.jar eureka-client$i.jar
    pid=`ps -ef | grep eureka-client$i.jar | grep -v 'grep' | awk '{print $2}'`
    if [ -n "$pid" ];
    then
        kill -9 $pid
    fi
    nohup java -jar eureka-client$i.jar --spring.profiles.active=client$i &
done
